xen.git
18 years agohvm: Sync SVM CR4 handling with VMX.
Keir Fraser [Wed, 27 Jun 2007 19:17:54 +0000 (20:17 +0100)]
hvm: Sync SVM CR4 handling with VMX.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFix VMX guest can't boot after MCE enabled.
Keir Fraser [Wed, 27 Jun 2007 19:08:21 +0000 (20:08 +0100)]
Fix VMX guest can't boot after MCE enabled.
Signed-off-by: Xin Li <xin.b.li@intel.com>
18 years agox86: remove unused nopaging_gdt_descr
Keir Fraser [Wed, 27 Jun 2007 19:00:50 +0000 (20:00 +0100)]
x86: remove unused nopaging_gdt_descr
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
18 years agoRemove incorrect __init prefixes
Keir Fraser [Wed, 27 Jun 2007 18:59:21 +0000 (19:59 +0100)]
Remove incorrect __init prefixes

Following functions can be __init in Linux, however shouldn't
in Xen. __print_IO_APIC is called by keyhandler, while
setup_ioapic_dest is invoked in one platform hypercall.

Signed-off-by Kevin Tian <kevin.tian@intel.com>

18 years ago[VMX] Set up GUEST_CR0 as well as CR0_READ_SHADOW when restoring saved
Tim Deegan [Tue, 26 Jun 2007 16:54:10 +0000 (17:54 +0100)]
[VMX] Set up GUEST_CR0 as well as CR0_READ_SHADOW when restoring saved
vcpus.  Also simplify the CR3 reload path.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
18 years agoDeinitialize timers before destroying the local apic; this protects us
Steven Hand [Tue, 26 Jun 2007 11:40:37 +0000 (12:40 +0100)]
Deinitialize timers before destroying the local apic; this protects us
against a late firing timer callback function (e.g. hpet_timer_fn) which
tries to access local APIC state.

Signed-off-by: Steven Hand <steven@xensource.com>
18 years agoioemu: Fix ifdef __x86_64__
kfraser@localhost.localdomain [Mon, 25 Jun 2007 15:52:39 +0000 (16:52 +0100)]
ioemu: Fix ifdef __x86_64__
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoi386: Simplify failsafe callback handling.
kfraser@localhost.localdomain [Thu, 21 Jun 2007 20:36:26 +0000 (21:36 +0100)]
i386: Simplify failsafe callback handling.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFix x86/64 failsafe callback handling.
kfraser@localhost.localdomain [Thu, 21 Jun 2007 17:02:50 +0000 (18:02 +0100)]
Fix x86/64 failsafe callback handling.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agohvm svm: No guest access to SVM MSRs.
kfraser@localhost.localdomain [Thu, 21 Jun 2007 14:17:31 +0000 (15:17 +0100)]
hvm svm: No guest access to SVM MSRs.
Signed-off-by: Mats Petersson <mats.petersson@amd.com>
18 years agox86: machine check exception handling
kfraser@localhost.localdomain [Thu, 21 Jun 2007 14:10:04 +0000 (15:10 +0100)]
x86: machine check exception handling

Properly handle MCE (connecting the exisiting, but so far unused
vendor specific handlers). HVM guests don't own CR4.MCE (and hence
can't suppress the exception) anymore, preventing silent machine
shutdown.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: clear guest's EFLAGS.RF after emulating instructions
kfraser@localhost.localdomain [Thu, 21 Jun 2007 13:03:57 +0000 (14:03 +0100)]
x86: clear guest's EFLAGS.RF after emulating instructions
Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agoi386: remove NMI deferral by instead making sure selector registers
kfraser@localhost.localdomain [Thu, 21 Jun 2007 11:13:06 +0000 (12:13 +0100)]
i386: remove NMI deferral by instead making sure selector registers
are always stored/restored correctly despite the potential for an NMI
(and also MCE, with a subsequent patch) to kick in.

The idea is to always check values read from %ds and %es against
__HYPERVISOR_DS, and only store into the current frame (all normal
handlers) or the outer-most one (NMI and MCE) if the value read is
different. That way, any NMI or MCE occurring during frame setup will
store selectors not saved so far on behalf of the interrupted handler,
with that interrupted handler either having managed to read the guest
selector (in which case it can store it regardless of whether NMI/MCE
kicked in between the read and the store) or finding __HYPERVISOR_DS
already in the register, in which case it'll know not to store (as the
nested handler would have done the store).

For the restore portion this makes use of the fact that there's
exactly one such code sequence, and by moving the selector restore
part past all other restores (including all stack pointer adjustments)
the NMI/MCE handlers can safely detect whether any selector would have
been restored already (by range checking EIP) and move EIP back to the
beginning of the selector restore sequence without having to play with
the stack pointer itself or any other gpr.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agolibxenguest: Add another range check to dom restore.
kfraser@localhost.localdomain [Thu, 21 Jun 2007 11:10:01 +0000 (12:10 +0100)]
libxenguest: Add another range check to dom restore.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agolibxenguest: Add missing range-check on count field read from a domain
kfraser@localhost.localdomain [Thu, 21 Jun 2007 08:47:39 +0000 (09:47 +0100)]
libxenguest: Add missing range-check on count field read from a domain
save/restore file.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoRename ddc_info -> vbeddc_info in interface header.
kfraser@localhost.localdomain [Wed, 20 Jun 2007 18:31:37 +0000 (19:31 +0100)]
Rename ddc_info -> vbeddc_info in interface header.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoAdd hypercall function for retrieving EDID info
kfraser@localhost.localdomain [Wed, 20 Jun 2007 18:24:08 +0000 (19:24 +0100)]
Add hypercall function for retrieving EDID info
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoRemove stray semi-colon in macro.
kfraser@localhost.localdomain [Wed, 20 Jun 2007 18:08:45 +0000 (19:08 +0100)]
Remove stray semi-colon in macro.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Add hypercall function for retrieving EDD info.
kfraser@localhost.localdomain [Wed, 20 Jun 2007 17:43:04 +0000 (18:43 +0100)]
x86: Add hypercall function for retrieving EDD info.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agotools: Adjust tools' path calculation.
kfraser@localhost.localdomain [Wed, 20 Jun 2007 16:07:15 +0000 (17:07 +0100)]
tools: Adjust tools' path calculation.

I'm suggesting this change to make another tiny step towards the
ability to run the tools e.g. out of the build tree (so that multiple
different Xen versions can co-exist without the requirement to
re-install the respective version with each boot).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agox86: early exception enhancement
kfraser@localhost.localdomain [Wed, 20 Jun 2007 16:05:48 +0000 (17:05 +0100)]
x86: early exception enhancement

In order to at least have some minimal debuging capabilities when Xen
crashes really early, dump out registers and stack contents in a raw
form.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agotools: Create directory /var/lib/xen at install target.
kfraser@localhost.localdomain [Wed, 20 Jun 2007 15:58:21 +0000 (16:58 +0100)]
tools: Create directory /var/lib/xen at install target.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agokernel command line extension
kfraser@localhost.localdomain [Wed, 20 Jun 2007 15:52:01 +0000 (16:52 +0100)]
kernel command line extension

In order to allow appending to the dom0 command line even with boot
loaders that only allow editing the kernel (i.e. Xen in our case)
command line, support a '--' separator option.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: introduce specialized clear_page()
kfraser@localhost.localdomain [Wed, 20 Jun 2007 15:18:03 +0000 (16:18 +0100)]
x86: introduce specialized clear_page()

More than doubles performance of page clearing on not too old
processors (SSE2 supported).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoUse clear_page() wherever possible/reasonable instead of open coded
kfraser@localhost.localdomain [Wed, 20 Jun 2007 14:33:14 +0000 (15:33 +0100)]
Use clear_page() wherever possible/reasonable instead of open coded
memset() calls (likewise a few replacements memcpy -> copy_page).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agoEnhance guest memory accessor macros so that source operands can be
kfraser@localhost.localdomain [Wed, 20 Jun 2007 14:29:53 +0000 (15:29 +0100)]
Enhance guest memory accessor macros so that source operands can be
pointers to const or arrays.

Only build-tested on ia64, and untested for powerpc (which, however,
is almost identical to ia64, except for an apparent bug in the original
version of __copy_field_{from,to}_guest in that the field offset was
multiplied by the field size).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agox86: Use 64-bit arithmetic in reserve_in_boot_e820().
kfraser@localhost.localdomain [Wed, 20 Jun 2007 14:08:32 +0000 (15:08 +0100)]
x86: Use 64-bit arithmetic in reserve_in_boot_e820().
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agohvm/x86: vendor-specific code can call vendor-specific routines directly
kfraser@localhost.localdomain [Wed, 20 Jun 2007 14:06:17 +0000 (15:06 +0100)]
hvm/x86: vendor-specific code can call vendor-specific routines directly
Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agox86/hvm: determine shared info format earlier.
kfraser@localhost.localdomain [Wed, 20 Jun 2007 14:03:39 +0000 (15:03 +0100)]
x86/hvm: determine shared info format earlier.

Latch guest shared info format when hypercall page is being set up
rather than during an arbitrarily selected hypercall.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: fix early option scanning
kfraser@localhost.localdomain [Wed, 20 Jun 2007 13:57:49 +0000 (14:57 +0100)]
x86: fix early option scanning

Make sure command lines like
... vgaxyz vga=
... console=vga vga=
do not mistakenly ignore the vga= option due to finding 'vga' earlier
on the line.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFix xm vcpu-set command for managed domains, to take effect immediately.
kfraser@localhost.localdomain [Wed, 20 Jun 2007 13:43:41 +0000 (14:43 +0100)]
Fix xm vcpu-set command for managed domains, to take effect immediately.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years agohvm: Ensure ioemu sees media-change events even when media filename
kfraser@localhost.localdomain [Wed, 20 Jun 2007 13:41:27 +0000 (14:41 +0100)]
hvm: Ensure ioemu sees media-change events even when media filename
remains constant my writing a dummy blank string first.
Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>
18 years agohvm: Fix ioemu Qcow support.
kfraser@localhost.localdomain [Wed, 20 Jun 2007 13:36:11 +0000 (14:36 +0100)]
hvm: Fix ioemu Qcow support.

Normally by default, SIGUSR2 is not blocked, so the signal masks of
SIGUSR2 in all threads is unblocked.

When creating HVM guest, if we use the Qcow format image file, in the
main thread, Qcow uses SIGUSR2 to be notified of the completion of the
request after it issues an AIO request; in tools/ioemu/block.c:
bdrv_read_em(), in some point between bdrv_aio_read() and
qemu_aio_wait(), Dom0 may send a SIGUSR2 to Qemu immediately to
indicate the completion of an AIO request -- since at the moment
SIGUSR2 in main thread is blocked by qemu_aio_wait_start(), the signal
may be delivered to one non-main thread, causing the signal handler of
SIGUSR2 is invoked, then the main thread hangs in
qemu_aio_wait()->syswait()...

This patch blocks SIGUSR2 at the beginning of Qemu's main(), so it
ensures SIGUSR2 is blocked by default when a new thread is created,
then only the threads that use the signal unblock it.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
18 years ago32-on-64: First slot of hidden L4 page directory must start life as zero.
kfraser@localhost.localdomain [Wed, 20 Jun 2007 12:39:54 +0000 (13:39 +0100)]
32-on-64: First slot of hidden L4 page directory must start life as zero.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years ago32-on-64: Fix error path where we fail to successfully switch a guest
kfraser@localhost.localdomain [Wed, 20 Jun 2007 12:38:48 +0000 (13:38 +0100)]
32-on-64: Fix error path where we fail to successfully switch a guest
into compat mode.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years ago32-on-64: Fix error path from memory_op() hypercall.
kfraser@localhost.localdomain [Wed, 20 Jun 2007 12:38:22 +0000 (13:38 +0100)]
32-on-64: Fix error path from memory_op() hypercall.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agohvm: Support injection of virtual NMIs and clean up ExtInt handling in general.
kfraser@localhost.localdomain [Wed, 20 Jun 2007 10:50:16 +0000 (11:50 +0100)]
hvm: Support injection of virtual NMIs and clean up ExtInt handling in general.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years ago[HVM][SVM] flush all entries from guest ASIDs when xen writes CR3.
Tim Deegan [Wed, 20 Jun 2007 09:55:37 +0000 (10:55 +0100)]
[HVM][SVM] flush all entries from guest ASIDs when xen writes CR3.
This makes the assumptions about TLB flush behaviour in the page-type
system and the shadow code safe again, and fixes a corner case of NPT
log-dirty.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
18 years agox86: retrieve VBE EDID/DDC info independent of used video mode
kfraser@localhost.localdomain [Tue, 19 Jun 2007 17:07:53 +0000 (18:07 +0100)]
x86: retrieve VBE EDID/DDC info independent of used video mode

The code to retrieve this information was protected by a check of a
variable (vbe_version) that would get initialized only when a VESA
mode was selected on the command line.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
At the same time I cleaned up use of 'scratch space' at address
modelist and beyond.

Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoblktap: Add fallback code to blktap for missing poll-on-aio support.
kfraser@localhost.localdomain [Tue, 19 Jun 2007 15:32:28 +0000 (16:32 +0100)]
blktap: Add fallback code to blktap for missing poll-on-aio support.

blktap requires a xen specific kernel AIO ABI which has been vetoed by
upstream in favour of another approach. Rather than include this ABI,
Fedora has been carrying a patch which makes tap:aio use a thread to
poll for aio events and notify the main thread via a pipe.

The upstream approach of allowing io_getevents() poll normal file
descriptors via epoll is still progressing:
 http://lkml.org/lkml/2007/1/3/16

but when that does make it upstream, blktap will require significant
re-working to use that approach.

In the meantime, here's a patch which uses the poll-in-a-thread
approach only if AIO poll support isn't available. It also hides the
details behind a simple abstraction and makes both tap:aio and
tap:qcow use it.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
18 years agotools: Allow xendomains to handle domain names >16 characters
kfraser@localhost.localdomain [Tue, 19 Jun 2007 15:29:22 +0000 (16:29 +0100)]
tools: Allow xendomains to handle domain names >16 characters

The xendomains init script parses the output of "xm list", and
since xm list restricts the length of domains to 16 characters the
xendomain script cannot handle long domain names.

This patch makesit parse the output of "xm list -l" instead.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
18 years agoioemu: Assembler memcpy() for x86, and lowest-common-denominator
kfraser@localhost.localdomain [Tue, 19 Jun 2007 15:08:15 +0000 (16:08 +0100)]
ioemu: Assembler memcpy() for x86, and lowest-common-denominator
memcpy() function for all others, avoiding noisy longword copies on
ia64.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agotools: Fix compiler warning.
kfraser@localhost.localdomain [Tue, 19 Jun 2007 14:55:13 +0000 (15:55 +0100)]
tools: Fix compiler warning.
From: Charles Coffing <ccoffing@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agohvm svm: Log into 'xm dmesg' that SVM NPT is enabled.
kfraser@localhost.localdomain [Tue, 19 Jun 2007 14:39:08 +0000 (15:39 +0100)]
hvm svm: Log into 'xm dmesg' that SVM NPT is enabled.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Re-introduce VIDEO_CURRENT_MODE into video.S video-mode-setting
kfraser@localhost.localdomain [Tue, 19 Jun 2007 14:09:59 +0000 (15:09 +0100)]
x86: Re-introduce VIDEO_CURRENT_MODE into video.S video-mode-setting
code, and make visible at the command line via 'vga=current'.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFurther fixes for 32on64 bit kexec.
Ian Campbell [Tue, 19 Jun 2007 14:03:55 +0000 (15:03 +0100)]
Further fixes for 32on64 bit kexec.

* switch to a suitable stack before jumping to compatibility mode.
* return the correct range for KEXEC_RANGE_MA_XEN.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agohvm: Fix deadlock in vpt.c and clean up some more.
kfraser@localhost.localdomain [Tue, 19 Jun 2007 13:52:53 +0000 (14:52 +0100)]
hvm: Fix deadlock in vpt.c and clean up some more.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFix 32on64 kexec trampoline. This was broken when Xen was modified to
Ian Campbell [Tue, 19 Jun 2007 10:06:25 +0000 (11:06 +0100)]
Fix 32on64 kexec trampoline. This was broken when Xen was modified to
physically relocate itself.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agohvm vmx: Make VMX-related MSRs invisible to the guest.
kfraser@localhost.localdomain [Mon, 18 Jun 2007 15:59:06 +0000 (16:59 +0100)]
hvm vmx: Make VMX-related MSRs invisible to the guest.
Signed-off-by: Shane Wang <shane.wang@intel.com>
18 years agox86: Code style in rdmsr_hypervisor_regs() is not consistent with
kfraser@localhost.localdomain [Mon, 18 Jun 2007 15:52:04 +0000 (16:52 +0100)]
x86: Code style in rdmsr_hypervisor_regs() is not consistent with
wrmsr_hypervisor_regs(). Sync them up.
Signed-off-by: Shane Wang <shane.wang@intel.com>
18 years agox86/64: Avoid bogus mbi pointer into relocated Xen address space.
kfraser@localhost.localdomain [Mon, 18 Jun 2007 15:48:05 +0000 (16:48 +0100)]
x86/64: Avoid bogus mbi pointer into relocated Xen address space.
Prevent similar bugs in future by poisoning the relocated bottom
megabyte.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Boot trampoline cleanups suggested by Xin Li.
kfraser@localhost.localdomain [Mon, 18 Jun 2007 15:47:16 +0000 (16:47 +0100)]
x86: Boot trampoline cleanups suggested by Xin Li.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agodocs: Fix docs install when graphvix is not installed.
Keir Fraser [Mon, 18 Jun 2007 11:11:36 +0000 (12:11 +0100)]
docs: Fix docs install when graphvix is not installed.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxend: Revert 15252:31ee1768e911 ("Make device detach wait for detach to complete").
Keir Fraser [Sat, 16 Jun 2007 10:18:44 +0000 (11:18 +0100)]
xend: Revert 15252:31ee1768e911 ("Make device detach wait for detach to complete").

Has a bad interaction with 12520 in destroyDevice(), where devid is
not an integer as expected.

I'm not sure which of these changesets is really the bogus one, but
this one went in later so it loses. :-)

Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoMerge with xen-ia64-unstable
Keir Fraser [Sat, 16 Jun 2007 09:42:06 +0000 (10:42 +0100)]
Merge with xen-ia64-unstable

18 years agomerge with xen-unstable.hg
Alex Williamson [Fri, 15 Jun 2007 19:33:11 +0000 (13:33 -0600)]
merge with xen-unstable.hg

18 years ago[IA64] Fix dom0vp_expose_p2m()
Alex Williamson [Fri, 15 Jun 2007 18:38:35 +0000 (12:38 -0600)]
[IA64] Fix dom0vp_expose_p2m()

It exposes one more zero p2m page

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years ago[IA64] RBS is now in vcpu_guest_context_regs.
Alex Williamson [Fri, 15 Jun 2007 18:36:04 +0000 (12:36 -0600)]
[IA64] RBS is now in vcpu_guest_context_regs.

As there is not anymore local variable of type vcpu_guest_context_regs in
the hypervisor the rbs field (16KB) can be put in the structure.
Code to read/write the field added.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
18 years ago[IA64] Add error checking to nvram store mkdir
Alex Williamson [Fri, 15 Jun 2007 17:34:34 +0000 (11:34 -0600)]
[IA64] Add error checking to nvram store mkdir

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
18 years ago[HVM] HAP tidying.
Tim Deegan [Fri, 15 Jun 2007 15:51:08 +0000 (16:51 +0100)]
[HVM] HAP tidying.
Tighten up locking discipline, dead/useless code and unnecessary VMEXITS.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
18 years agokexec: Flush console on kexec_crash().
Keir Fraser [Fri, 15 Jun 2007 15:30:10 +0000 (16:30 +0100)]
kexec: Flush console on kexec_crash().
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years ago[IA64] Create NVRAM save directory
Alex Williamson [Fri, 15 Jun 2007 15:25:09 +0000 (09:25 -0600)]
[IA64] Create NVRAM save directory

If you use RPM to install XEN, the directory(/usr/lib/xen/boot)
will be removed when you un-install the RPM. This patch create
that directory before NVRAM file creating.

Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
18 years agohvm: Add locking to platform timers.
Keir Fraser [Fri, 15 Jun 2007 14:30:49 +0000 (15:30 +0100)]
hvm: Add locking to platform timers.
Handy for correctness.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoMake Xen headers lint-clean, and fix xs_wire.h for Solaris compiler.
Keir Fraser [Fri, 15 Jun 2007 10:50:54 +0000 (11:50 +0100)]
Make Xen headers lint-clean, and fix xs_wire.h for Solaris compiler.
Signed-off-by: John Levon <john.levon@sun.com>
Signed-off-by: Ryan Scott <ryan.scott@sun.com>
18 years agohvm: Simplify timer<->vcpu/domain conversion in RTC and PIT timer
Keir Fraser [Fri, 15 Jun 2007 09:36:31 +0000 (10:36 +0100)]
hvm: Simplify timer<->vcpu/domain conversion in RTC and PIT timer
models. These timers are always bound to vcpu0, where a specific vcpu
matters.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxend: Replace tabs with 8 whitespaces in DevController.py
Keir Fraser [Fri, 15 Jun 2007 09:01:32 +0000 (10:01 +0100)]
xend: Replace tabs with 8 whitespaces in DevController.py
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years agohvm: Fix multiplication overflow in hvm/pmtimer.c
Keir Fraser [Fri, 15 Jun 2007 08:42:39 +0000 (09:42 +0100)]
hvm: Fix multiplication overflow in hvm/pmtimer.c

Too many ACPI events (SCI) are raised on hvm because of
multiplication overflow.

FREQUENCE_PMTIMER=3579545
(1000000000ULL << 32) / FREQUENCE_PMTIMER = 0xae9a7b1663a
pmt_cycles_until_flip =~ 0x80000000
0xae9a7b1663a*0x80000000 = overflow!!!

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years agoFix compile errors in PV-on-HVM drivers because of missing asm/gnttab_dma.h.
Keir Fraser [Fri, 15 Jun 2007 08:32:22 +0000 (09:32 +0100)]
Fix compile errors in PV-on-HVM drivers because of missing asm/gnttab_dma.h.
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
18 years agoUpdate Solaris balloon ioctl value
Keir Fraser [Fri, 15 Jun 2007 08:18:42 +0000 (09:18 +0100)]
Update Solaris balloon ioctl value

The balloon ioctl value should use a 32-bit value instead of a 16-bit
value to distinguish itself from other ioctls.

Signed-off-by: Ryan Scott <ryan.scott@sun.com>
18 years agoRemove bogus xenfb include; breaks Solaris build.
Keir Fraser [Fri, 15 Jun 2007 08:17:49 +0000 (09:17 +0100)]
Remove bogus xenfb include; breaks Solaris build.
Signed-off-by: John Levon <john.levon@sun.com>
18 years agoES7000: Fix ES7000-specific APIC code.
Keir Fraser [Fri, 15 Jun 2007 08:15:28 +0000 (09:15 +0100)]
ES7000: Fix ES7000-specific APIC code.
Signed-off-by: Raj Subrahmanian <raj.subrahmanian@unisys.com>
18 years agohvm: Reintroduce hpet_migrate_timers(), as it is not covered by vpt
Keir Fraser [Fri, 15 Jun 2007 08:08:19 +0000 (09:08 +0100)]
hvm: Reintroduce hpet_migrate_timers(), as it is not covered by vpt
logic, but fix so that only VCPU0 migrates the timers.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years ago[IA64] Don't try to save nvram on PV domains
Alex Williamson [Thu, 14 Jun 2007 21:32:22 +0000 (15:32 -0600)]
[IA64] Don't try to save nvram on PV domains

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
18 years ago[IA64] Revive ACPI power management for IA64.
Alex Williamson [Thu, 14 Jun 2007 21:29:52 +0000 (15:29 -0600)]
[IA64] Revive ACPI power management for IA64.

c/s 14552 took PM1a_EVT_BLK registers from Qemu into Xen.
Also support ACPI PM timer function.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years ago[IA64] symlink kregs.h into libxc build
Alex Williamson [Thu, 14 Jun 2007 21:13:59 +0000 (15:13 -0600)]
[IA64] symlink kregs.h into libxc build

Suggested by Akio Takebe

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
18 years ago[IA64] Fix dom0 load address
Alex Williamson [Thu, 14 Jun 2007 20:36:15 +0000 (14:36 -0600)]
[IA64] Fix dom0 load address

Calculate load address of dom0 image based on xen_pstart rather than
address from ELF image.

Signed-off-by: Jes Sorensen <jes@sgi.com>
18 years agohvm: Timer device model cleanups.
kfraser@localhost.localdomain [Thu, 14 Jun 2007 17:01:42 +0000 (18:01 +0100)]
hvm: Timer device model cleanups.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoUpdate docs for 'edd=' boot option.
kfraser@localhost.localdomain [Thu, 14 Jun 2007 17:01:07 +0000 (18:01 +0100)]
Update docs for 'edd=' boot option.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agohvm svm: Fix for BSOD when "migrating" from Intel to AMD.
kfraser@localhost.localdomain [Thu, 14 Jun 2007 14:54:57 +0000 (15:54 +0100)]
hvm svm: Fix for BSOD when "migrating" from Intel to AMD.

The Intel processor driver for Windows (XP and later at least) reads
an MSR that AMD doesn't have. This causes GP-fault in kernel mode,
which causes blue-screen-of-death on Windows. This prevents a
disk-image that was installed on Intel from starting on an AMD
processor.

This patch "fixes" the problem by allowing reads from the msr,
returning all zero's (which is a valid, if not particulary
meaningful, value for this register).

Signed-off-by: Mats Petersson <mats.petersson@amd.com>
18 years agohvm vmx: Various cleanups and clarifications around event injection.
Keir Fraser [Wed, 13 Jun 2007 21:24:28 +0000 (22:24 +0100)]
hvm vmx: Various cleanups and clarifications around event injection.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxenapi: Implement VM.set_VCPUs_at_startup and VM.set_VCPUs_max XenAPI
kfraser@localhost.localdomain [Wed, 13 Jun 2007 10:28:13 +0000 (11:28 +0100)]
xenapi: Implement VM.set_VCPUs_at_startup and VM.set_VCPUs_max XenAPI
methods in xend.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
18 years agoxenapi: Implement XenAPI method VBD.set_mode in python.
kfraser@localhost.localdomain [Wed, 13 Jun 2007 10:27:47 +0000 (11:27 +0100)]
xenapi: Implement XenAPI method VBD.set_mode in python.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
18 years agoxenapi: Fix segfault in libxenapi.
kfraser@localhost.localdomain [Wed, 13 Jun 2007 10:27:08 +0000 (11:27 +0100)]
xenapi: Fix segfault in libxenapi.

When calling xen_vbd_set_mode(), libxenapi attempted to convert enum
mode parameter to a string twice - resulting in segfault.  Removed
first conversion since conversion is taking place in
marshalling/demarshalling layer. Fixed similar double enum conversion
in other places as well.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
18 years agoxentop: Fix -b option (batch mode).
kfraser@localhost.localdomain [Wed, 13 Jun 2007 10:13:11 +0000 (11:13 +0100)]
xentop: Fix -b option (batch mode).

Some curses libraries don't work with xentop in batch mode, avoid
those calls. Avoid the over-verbose summary lines when batch mode is
requested.

Signed-off-by: Gary Pennington <gary.pennington@sun.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoAllow make targets to be called via make -C
kfraser@localhost.localdomain [Wed, 13 Jun 2007 10:05:47 +0000 (11:05 +0100)]
Allow make targets to be called via make -C

Change PWD to CURDIR in new mk.linux-2.6-xen to allow make targets to
be called via a make -C

From: Ben Guthro <bguthro@virtualiron.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: ioapic_write() must check for weird redir entries with special
kfraser@localhost.localdomain [Wed, 13 Jun 2007 09:39:48 +0000 (10:39 +0100)]
x86: ioapic_write() must check for weird redir entries with special
delivery mode yet apparently valid vectoring information.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoMerge with xen-unstable.hg (staging)
Alex Williamson [Wed, 13 Jun 2007 02:41:08 +0000 (20:41 -0600)]
Merge with xen-unstable.hg (staging)

18 years ago[IA64] Fix xen build warning
Alex Williamson [Tue, 12 Jun 2007 22:54:19 +0000 (16:54 -0600)]
[IA64] Fix xen build warning

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
18 years ago[IA64] libxc trivial fix compilation error.
Alex Williamson [Tue, 12 Jun 2007 21:23:55 +0000 (15:23 -0600)]
[IA64] libxc trivial fix compilation error.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years ago[IA64] Provide pxm_to_node and node_to_pxm translation functions
Alex Williamson [Tue, 12 Jun 2007 21:22:02 +0000 (15:22 -0600)]
[IA64] Provide pxm_to_node and node_to_pxm translation functions

Required for NUMA node table setup on sn2.

Signed-off-by: Jes Sorensen <jes@sgi.com>
18 years ago[IA64] Change virtual address of XEN UC indentity area.
Alex Williamson [Tue, 12 Jun 2007 21:20:06 +0000 (15:20 -0600)]
[IA64] Change virtual address of XEN UC indentity area.

This slightly simplifies the code and makes flexible map possible.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
18 years ago[IA64] Slightly modify xen memory map to make room for IO space.
Alex Williamson [Tue, 12 Jun 2007 21:17:16 +0000 (15:17 -0600)]
[IA64] Slightly modify xen memory map to make room for IO space.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
18 years ago[IA64] Use virtualized psr in vcpu context instead of real psr.
Alex Williamson [Tue, 12 Jun 2007 21:16:03 +0000 (15:16 -0600)]
[IA64] Use virtualized psr in vcpu context instead of real psr.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
18 years ago[IA64] Support for multiple I/O port spaces
Alex Williamson [Tue, 12 Jun 2007 21:07:05 +0000 (15:07 -0600)]
[IA64] Support for multiple I/O port spaces

Linux has support for multiple I/O port spaces on a system.  Depending
on the system configuration, this might allow for 64k of I/O port space
per PCI bus.  The "extended" I/O port ranges are described to the OS by
_CRS methods on PCI root devices in ACPI namespace.  For instance, on my
system, /proc/iomem shows several entries like these:

80000000000-80003ffffff : PCI Bus 0000:00 I/O Ports 01000000-0100ffff
80100000000-80103ffffff : PCI Bus 0000:01 I/O Ports 02000000-0200ffff
80200000000-80203ffffff : PCI Bus 0000:0a I/O Ports 03000000-0300ffff
80300000000-80303ffffff : PCI Bus 0000:0f I/O Ports 04000000-0400ffff
...

These describe MMIO ranges that provide I/O port ranges per PCI bus.
My /proc/ioports then shows entries like these:

01000000-0100ffff : PCI Bus 0000:00
  01001000-010010ff : 0000:00:04.0
02000000-0200ffff : PCI Bus 0000:01
  02001000-02001fff : PCI Bus #02
    02001000-0200107f : 0000:02:07.0
      02001000-0200107f : tulip
    02001080-020010ff : 0000:02:06.0
      02001080-020010ff : tulip
    02001100-0200117f : 0000:02:05.0
    02001180-020011ff : 0000:02:04.0
      02001180-020011ff : tulip
  02002000-0200203f : 0000:01:02.1
  02002040-0200207f : 0000:01:02.0
    02002040-0200207f : e1000
03000000-0300ffff : PCI Bus 0000:0a
...

Xen currently has no concept of these extended I/O port space ranges and
prevents dom0 from doing the MMIO transactions required to access these
ports.  This patch solves the problem.  First we need to make
ioports_permit/deny_access() aware that multiple I/O port ranges with
different MMIO base address exist.  Next we need to provide a mechanism
to register new I/O port spaces, for this I've created the dom0vp op
IA64_DOM0VP_add_io_space.  This allows dom0 to do the work of finding
the ranges in ACPI namespace since we don't want to add that kind of
bulk to Xen.  Finally, dom0 needs to make use of this interface when new
ranges are found.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
18 years ago[IA64][BUILDER] Define native protocol ABI for IA64 guests.
Alex Williamson [Tue, 12 Jun 2007 20:58:39 +0000 (14:58 -0600)]
[IA64][BUILDER] Define native protocol ABI for IA64 guests.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years ago[IA64] Implement gnttab replace_and_unmap
Alex Williamson [Tue, 12 Jun 2007 14:48:02 +0000 (08:48 -0600)]
[IA64] Implement gnttab replace_and_unmap

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years ago[IA64] Compilation fix of c/s 15180:1f7a6456c330 of xen-unstable.hg
Alex Williamson [Tue, 12 Jun 2007 14:39:24 +0000 (08:39 -0600)]
[IA64] Compilation fix of c/s 15180:1f7a6456c330 of xen-unstable.hg

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years agox86: Initialise %ds when booting APs, otherwise data accesses go to
kfraser@localhost.localdomain [Tue, 12 Jun 2007 13:06:37 +0000 (14:06 +0100)]
x86: Initialise %ds when booting APs, otherwise data accesses go to
the wrong place.
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Gather BIOS EDD info during boot.
kfraser@localhost.localdomain [Tue, 12 Jun 2007 13:03:09 +0000 (14:03 +0100)]
x86: Gather BIOS EDD info during boot.
Still needs plumbing to dom0.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFix fully-virtualized core dumps for 32-bit guests.
kfraser@localhost.localdomain [Tue, 12 Jun 2007 10:39:51 +0000 (11:39 +0100)]
Fix fully-virtualized core dumps for 32-bit guests.
Signed-off-by: Chris Lalancette <clalance@redhat.com>